//
//  LoginMainController2.m
//  e_cloud
//
//  Created by 王晓萌 on 2017/5/23.
//  Copyright © 2017年 Facebook. All rights reserved.
//

#import "LoginMainController2.h"
#import "AppDelegate.h"

@interface LoginMainController2 ()

@end

@implementation LoginMainController2

- (void)viewDidLoad {
    [super viewDidLoad];
  
  UIButton * leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
  [self.view addSubview:leftButton];
  
  
  [leftButton mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.equalTo(self.view).offset(0);
    make.top.equalTo(self.view).offset(15);
    make.width.height.mas_equalTo(44);
  }];
    [leftButton setImage:[UIImage imageNamed:@"back_icon" ] forState:UIControlStateNormal];
  [leftButton addTarget:self action:@selector(backPressed:)forControlEvents:UIControlEventTouchUpInside];
  
}

- (void)backPressed:(UIButton *)sender{
  AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
//  [delegate.preController.navigationController popViewControllerAnimated:YES];
    UIApplication *application = [UIApplication sharedApplication];
    UIWindow *window = application.keyWindow;
    
    
    
    UIViewController * rootViewC= window.rootViewController;
    [rootViewC.navigationController popViewControllerAnimated:YES];

}



@end
